rm(list = ls())

## packages 

library(tidyverse)
library(fixest)

## Load data 
## excluding Brandenburg and Mecklenburg-Western Pomerania

dat <- readRDS('data/civey_clean.rds') %>%
  filter(!state_id %in% c('12', '13')) 

## Estimate 

feols(vote_afd ~ treated_post | user_id + date, 
            data = dat,
            fsplit = ~ foreign_non_eu_share_bin, 
            cluster = ~ user_id) %>%
  etable()

